import { createApp } from 'vue'

import App from './App.vue'

import { createPinia } from 'pinia'

import router from './router'
import directives from '@/utils/directives'
/*
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
*/

const app = createApp(App);

import { message, Modal } from 'ant-design-vue';
import 'ant-design-vue/es/message/style/index';
app.config.globalProperties.$message = message;

import 'ant-design-vue/es/modal/style/index';
app.config.globalProperties.$confirm = Modal.confirm;
app.config.globalProperties.$info = Modal.info;
app.config.globalProperties.$success = Modal.success;
app.config.globalProperties.$error = Modal.error;
app.config.globalProperties.$warning = Modal.warning;
app.config.globalProperties.$auth = directives

// 使用自定义指令
app.use(directives)

import '@/styles/common.scss'

import Directives from "./directives"
app.use(Directives)

import VueCookies from 'vue-cookies';
VueCookies.config('1d', '/');
app.config.globalProperties.$cookies = VueCookies;
app.directive('my-directive', (el, binding, vnode) => {
	//el是对应的dom，可以通过el给对应添加事件监听 el.addEventListener
	// binding.value 就是通过 = 绑定的值，在传值的时候传到这 binding.value
	//vnode是节点
})
import { SvgIcon } from '@/components';

app
	.component('SvgIcon', SvgIcon)
	.use(createPinia())
	.use(router)
	//.use(Antd)
	.mount('#app')
